<?php //jQuery Validation ?>
<script type="text/javascript">
	$(document).ready(function(){
	     //Get the screen height and width
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
     
        //Set height and width to mask to fill up the whole screen
        $('#loading').css({'width':maskWidth,'height':maskHeight,'position':'absolute','top':'0','left':'0','z-index':'1000'});

        $("#confirm-resend").click(function(e){
                    	
					$("#resend-form").validate();
					e.preventDefault;
					if($("#resend-form").valid()){ //register if form is valid
					    $("#confirm-resend").attr('disabled','disabled');
					    resend($("#strEmail").val()); 
					
					}
		});
        
	});
		
	function resend(_strEmail)
	{
//		$('#message-modal').modal('close');
		$.post(base_url + "users/resend_email", {
			strEmail: _strEmail
		}, function(response){

				$("#loading").hide();
				$('#message-modal > span').html('');
				var res = $.parseJSON(response);
				$("#message-modal > span").html(res.message);
				if(res.success==0 || res.success==2)
				{
					$("#confirm-send").removeAttr('disabled');
				}
				
				$('#message-modal').modal('show');

		});
		//setTimeout("clear_html()","5000");
		return false;
	}		
	
	function clear_html()
	{
		$('#message-modal > span').html('');
	}
</script>